import request from '@/utils/request'
export function create(data){
    return request({
        url: '/role',
        method: 'post',
        data
    })
}

export function update(data){
    return request({
        url: '/role',
        method: 'put',
        data
    })
}

export function del(id){
    return request({
        url: '/role/'+data,
        method: 'delete'
    })
}

// 根据id或者对象
export function selectOne(id){
    return request({
        url: '/role/'+id,
        method: 'get'
    })

}
export function page(query) {
    return request({
        url: '/role/page',
        method: 'get',
        params: query
    })
}

export function all() {
    return request({
        url: '/role/all',
        method: 'get'
    })
}

export function menuTree() {
    return request({
        url: '/menu/menuTree',
        method: 'get'
    })
}

export function menuTreeChecked() {
    return request({
        url: '/menu/menuTreeChecked',
        method: 'get'
    })
}

export function updateRoleOperation(data){
    return request({
        url: '/roleResource/updateRoleOperation',
        method: 'post',
        data
    })
}

export function updateRoleResource(data){
    return request({
        url: '/roleResource/updateRoleResource',
        method: 'post',
        data
    })
}

export function getRoleResource(data) {
    return request({
        url: '/roleResource/list',
        method: 'get',
        params:data
    })
}
export function roleOperation(data) {
    return request({
        url: '/roleResource/roleOperation',
        method: 'get',
        params:data
    })
}